<template>
  <div>
    <img :src="baseUrl+'/captcha?type=login&xxxx='+time" alt="" @click="time=Date.now()">
    <el-input v-model="code" />
    <button @click="submit">登录</button>
  </div>
</template>
<script>
import axios from 'axios'
const _axios = axios.create({
  baseURL: process.env.VUE_APP_HMMM,
  withCredentials: true
})
export default {
  data() {
    return {
      baseUrl: process.env.VUE_APP_HMMM,
      code: '',
      time: Date.now()
    }
  },
  methods: {
    async submit() {
      const res = await _axios({
        url: '/login',
        method: 'POST',
        data: {
          'phone': '18511111111',
          'password': '12345678',
          'code': this.code
        }
      })
      console.log('登录', res)
    }
  }

}
</script>
<style>
</style>
